package com.yuw.othertools;

import org.junit.jupiter.api.Test;

public class ObjectTestDriver {

	@Test
	public void test01() {
		Object obj = "";
		boolean isOk = obj.equals("");
		
		String str = "";
		str.equals("");
	}
	
	@Test
	public void test02() {
				
		String str = "小明";
		String str1 = new String("小明");
		System.out.println(str.hashCode());
		System.out.println(str1.hashCode());
	}
	
	@Test
	public void test03() {
		// 创建两个学生对象
		Student stu0 = new Student("张三","15001",70);
		Student stu1 = new Student("张三","15001",70);
		System.out.println("stu0.equals(stu1)::"+stu0.equals(stu1));
		
		System.out.println(stu0.hashCode());
		System.out.println(stu1.hashCode());
	}
}
